$(document).ready(function() {
	
	$("#logout_a").click(function(){
		var url = window.location.href;
		$.ajax({
			type : "GET",
			url : "/musicai/account/logout",
			success: function(xml){
				var msg = $(xml).find("message").text();
				if(msg == "success"){
					$("#login_div").html("<a href=\"/musicai/account/apply\"" +
						">创建账户</a><span class=\"masthead-link-separator\">|</span><a href=\"/musicai/account/login?url="+url+"\">登录</a>");
				}
			}
		});
		
		//删除cookie
		$.cookie("name", null);
	});
});
